import {defineConfig} from 'vite';
import react from '@vitejs/plugin-react-swc';
import autoprefixer = require('autoprefixer');
import tailwindcss from 'tailwindcss';
import {VitePWA} from 'vite-plugin-pwa';
// https://vitejs.dev/config/
export default defineConfig({
    plugins: [
        react(),
        VitePWA({
            registerType: 'autoUpdate',
            injectRegister: 'auto',
            devOptions: {
                enabled: true
            },
            manifest: {
                name: 'Less Code For Data Visualization',
                short_name: 'LC4DV',
                start_url: '/',
                display: 'standalone',
                theme_color: '#f2f4f6',
                icons: [
                    {
                        src: 'icon.ico',
                        sizes: '512x512',
                        type: 'image/png',
                        purpose: 'any'
                    }
                ]
            }
        })
    ],
    resolve: {
        alias: {
            '@': '/src'
        }
    },
    css: {
        postcss: {
            plugins: [
                tailwindcss,
                autoprefixer({
                    overrideBrowserslist: ['Android 4.1', 'iOS 7.1', 'Chrome > 87', 'ff > 78', 'ie >= 8', '> 1%']
                })
            ]
        },
        preprocessorOptions: {
            less: {
                javascriptEnabled: true
            }
        }
    }
});
